import 'package:flutter/material.dart';

class UserListMySelfItemWidget extends StatefulWidget {
  // final SimpleChannelUser? user;
  // final SimpleChannelUser? lastUser;
  final bool isRanking; //是否在排行榜
  const UserListMySelfItemWidget({
    super.key,
    // this.user,
    // this.lastUser,
    this.isRanking = false,
  });

  @override
  State<UserListMySelfItemWidget> createState() =>
      _UserListMySelfItemWidgetState();
}

class _UserListMySelfItemWidgetState extends State<UserListMySelfItemWidget> {
  @override
  Widget build(BuildContext context) {
    // int shareValue = 0;
    // if (widget.user != null && widget.lastUser != null) {
    //   shareValue =
    //       widget.lastUser!.contributionValue - widget.user!.contributionValue;
    // }

    return Container(
      decoration: const BoxDecoration(
        color: Colors.white,
        boxShadow: <BoxShadow>[
          BoxShadow(
              color: Colors.black54, blurRadius: 5.0, offset: Offset(0.0, 0.4))
        ],
      ),
      padding: const EdgeInsets.only(left: 22, right: 20, top: 0),
      height: 72,
      child: Row(
        children: [
          Text(
            widget.isRanking ? 'widget.user!.rank' : "-",
            style: const TextStyle(
                fontSize: 20,
                color: Color(0xFF9F9F9F),
                fontWeight: FontWeight.w600,
                height: 1),
          ),
          const SizedBox(
            width: 20,
          ),
          // AvatarImage(
          //     url: widget.user!.avatar,
          //     width: 50,
          //     height: 50,
          //     borderRadius: 25),
          const SizedBox(
            width: 10,
          ),
          const Expanded(
            child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Flexible(
                          child: Text(
                        'nickname',
                        maxLines: 1,
                        style: TextStyle(
                          overflow: TextOverflow.ellipsis,
                          fontSize: 13,
                          color: Color(0xff333333),
                          fontWeight: FontWeight.w500,
                        ),
                      )),
                      // SexAgeLabel(
                      //   isMale: widget.user!.gender == UserConstants.genderMan,
                      //   age: widget.user!.age.toString(),
                      //   startMargin: 4,
                      // )
                    ],
                  ),
                  SizedBox(
                    height: 4.5,
                  ),
                  Row(
                    children: [
// UserLevWidget
                      Text('UserLevWidget'),
                      Text('UserCarLevelWidget'),

                      // UserLevWidget(
                      //   vipImgStr: widget.user?.vipIcons.middleIcon,
                      // ),
                      // UserCarLevelWidget(
                      //   carLevel: widget.user!.car.carMetaInfo.level,
                      //   job: widget.user!.job,
                      // ),
                    ],
                  ),
                ]),
          ),
          const Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.end,
              children: [
                Text(
                  'contribute_few_value',
                  style: TextStyle(
                      fontSize: 11,
                      color: Color(0xff333333),
                      fontWeight: FontWeight.w400,
                      height: 1),
                ),
                SizedBox(
                  height: 5,
                ),
                // Visibility(
                //     visible: widget.lastUser != null,
                //     child: Text(
                //       widget.isRanking
                //           ? T.current!
                //               .distance_previous_few_left_value(shareValue)
                //           : T.current!.distance_rank_few_value(shareValue),
                //       style: const TextStyle(
                //         fontSize: 11,
                //         color: Color(0xFF999999),
                //         fontWeight: FontWeight.w400,
                //       ),
                //     )),
              ]),
        ],
      ),
    );
  }
}
